/**
 * Created by leo on 2/2.
 */
angular.module('panels')
    .directive('panelItilWorkflowProcessingStatusRanking', function () {
        return {
            scope: {},
            link: function (scope) {
                scope.panelTitle = '月度工单处理情况';
                scope.options = {
                    chart: {
                        type: 'bar'
                    },
                    colors: Highcharts.map(Highcharts.getOptions().colors, function (color) {
                        return {
                            radialGradient: {cx: 0.5, cy: 0.3, r: 0.7},
                            stops: [
                                [0, color],
                                [1, Highcharts.Color(color).brighten(-0.1).get('rgb')] // darken
                            ]
                        };
                    }),
                    title: {
                        text: ''
                    },
                    xAxis: {
                        categories: ['赵毅', '钱耳', '孙三', '李四', '周五', '武六', '郑琦', '王霸', '冯九', '陈实']
                    },
                    yAxis: {
                        min: 0,
                        title: {
                            enabled: false
                        }
                    },
                    tooltip: {
                        headerFormat: '<span style="font-size:10px">{point.key}</span><table>',
                        pointFormat: '<tr><td style="color:{series.color};padding:0">{series.name}: </td>' +
                        '<td style="padding:0"><b>{point.y} 条</b></td></tr>',
                        footerFormat: '</table>',
                        shared: true,
                        useHTML: true
                    },
                    plotOptions: {
                        column: {
                            pointPadding: 0.2,
                            borderWidth: 0
                        }
                    },
                    series: [{
                        name: '已处理',
                        data: [106, 129, 135, 144, 148, 176, 194, 216, 93, 123]

                    }, {
                        name: '超时',
                        data: [83, 78, 98, 93, 106, 84, 105, 104, 85, 92]

                    }, {
                        name: '未处理',
                        data: [65, 59, 59, 52, 48, 48, 47, 41, 34, 27]

                    }]
                };
            },
            templateUrl: 'app/panel/highcharts-default.html'
        };
    });